var currentUserInfo = ''
export function initUserInfo(userInfo) {
  currentUserInfo = userInfo
}

export function user() {
  return currentUserInfo;
};

//B
//部门角色查看
export function isPartyView() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('B_PARTY_VIEW') >= 0;
};
//部门编辑
export function isPartyEdit() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('B_PARTY_EDIT') >= 0;
};
//工作人员编辑
export function isPartyUserEdit() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('B_USER_EDIT') >= 0;
};
//角色新增编辑
export function isRoleEdit() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('B_ROLEGROUP_EDIT') >= 0;
};
//设备添加
export function isEquipmentAdd() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('B_EQUIP_ADD') >= 0;
};
//门店编辑新增删除
export function isEntityOperate() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('B_ENTITY_EDIT') >= 0;
};


//E
//会员查看
export function isMemberView() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_CUSTOMER_VIEW') >= 0;
};
//会员编辑新增
export function isMemberEdit() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_CUSTOMER_EDIT') >= 0;
};
//顾客查看
export function isCustomerView() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_CUSTOMER_VIEW') >= 0;
};
//顾客编辑
export function isCustomerEdit() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_CUSTOMER_EDIT') >= 0;
};
//考勤查看
export function isKaoQinView() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_KAOQIN_VIEW') >= 0;
};
//考勤设置
export function isKaoQinSet() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_KAOQIN_SET') >= 0;
};
//外来人员查看
export function isVisitorView() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_STRANGER_VIEW') >= 0;
};
//外来人员规则设置
export function isVisitorSet() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_STRANGER_SET') >= 0;
};
//考评查看
export function isAssessmentView() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_EVA_VIEW') >= 0;
};
//考评规则设置
export function isAssessmentSet() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_EVA_SET') >= 0;
};
//关注查看
export function isAttentionView() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_ATTENTION_VIEW') >= 0;
};
//关注规则设置
export function isAttentionSet() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_ATTENTION_SET') >= 0;
};
//模版编辑
export function isTempEdit() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_TEMPLATE_EDIT') >= 0;
};
//客群分析查看
export function isAnalysisView() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_CUS_ANA_VIEW') >= 0;
};
//客群分析设备设置 老顾客设置
export function isAnalysisSet() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_CUS_ANA_SET') >= 0;
};
//进出统计查看
export function isInOutView() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_WORKER_INOUT_VIEW') >= 0;
};
//进出统计设置
export function isInOutSet() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_WORKER_INOUT_SET') >= 0;
};
//活跃查看
export function isActiveView() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_WORKER_EFFORT_VIEW') >= 0;
};
//活跃设置
export function isActiveSet() {
  var cuinfo = user();
  return cuinfo && cuinfo.roles && cuinfo.roles.indexOf('E_WORKER_EFFORT_SET') >= 0;
};
